package com.flute.framework.autoprompt;

import java.util.HashMap;

public class CharacterFlyweight {
	private HashMap<String, String> map;
	private static CharacterFlyweight instance;

	private CharacterFlyweight() {
		this.map = new HashMap<String, String>();
	}

	public static CharacterFlyweight getInstance() {
		if (instance == null) {
			instance = new CharacterFlyweight();
		}

		return instance;
	}

	public String getStringObject(String string) {
		if (!map.containsKey(string)) {
			map.put(string, string);
		}

		return map.get(string);
	}
}
